←
▼
▲
→ ToolsLib.vbs
ソース
テスト
→ T_TextSection.vbs
T_MakeCrossedOldSections
Sub MakeCrossedOldSections( in_OutFolderPath as string, _
in_NewFolderPath as string or PathDictionaryClass, in_OldFolderPath as string, _
in_NewTxscPath as string, in_OldTxscPath as string, in_Option as Empty )
新しいセクションの構成に合わせるように、古い内容のセクションを集めます。
【引数】
in_OutFolderPath
in_NewFolderPath
出力ファイルを格納するフォルダーのパス
新しいセクションの構成を持つファイルが入ったフォルダーのパス
in_OldFolderPath
古い内容のセクションを持つファイルが入ったフォルダーのパス
in_OldFolderPath の中間ファイルを格納するフォルダーのパス
in_OldTxscPath
in_NewFolderPath の中間ファイルを格納するフォルダーのパス
in_NewTxscPath
Empty を指定してください
in_Option
→ T_CrossedOld フォルダー
in_NewFolderPath 引数に
のオブジェクトを指定できます。
in_NewFolderPath 引数に指定したファイルに対応する出力ファイルが in_OutFolderPath 引数に指定
したフォルダーに格納されます。
関連
中間ファイルは、
が出力するセクション インデックス ファイルです。
サンプル
Out
New
Old
A.txt
B.txt
/* Title: Section_A_1 */
This is old Section-A-1.
/* Title: Section_B_1 */
This is old Section-B-1.
/* Title: Section_B_2 */
This is old Section-B-2.
A.txt
/* Title: Section_A_1 */
New A-1.
New A-2.
B.txt
/* Title: Section_B_1 */
New B-1.
/* Title: Section_B_2 */
New B-2.
/* Title: Section_B_1 */
This is old Section-B-1.
Y.txt
X.txt
/* Title: Section_A_1 */
This is old Section-A-1.
/* Title: Section_B_2 */
This is old Section-B-2.
/* Title: Section_A_2 */
This is old Section-A-2.
/* Title: Section_A_2 */
/* Title: Section_A_2 */
This is old Section-A-2.
New フォルダーにある A.txt と同じ名前のファイルを、Out フォルダーに作成します。 その内容は、
New フォルダーにある A.txt のセクションの構成(順序)、すなわち、Section_A_1、Section_A_2 の
順になります。 セクションの名前は、
が入力する形式で記述します。
Natural Docs
形式のみ対応しています。 それぞれセクションの内容は、Old フォルダーに
現在は、
ある、すべてのファイルの中から検索して見つかったセクションをコピーした内容になります。
→ ModuleAssort
←
▼
▲
内部で
を呼び出しています。
MakeTextSectionIndexFile "*.c", "NaturalDocs", "C_Type", Empty, Empty
Sub MakeTextSectionIndexFile( Path as string or PathDictionaryClass,
TagTypeName as string, BeforeRootFullPath as string, AfterRootFullPath as string )
タグが付いたファイルから、セクション インデックス ファイルを更新します。
【引数】
Path
TagTypeName
セクション化されたテキスト ファイルのパス、または、
タグのタイプ、"NaturalDocs" を指定してください
テスト
サンプル
ソース
T_MakeTxScFile
.txsc ファイルのタイムスタンプの方が新しいときは、更新をせず、高速に処理します。
→ T_TextSection.vbs
→ ToolsLib.vbs
→ NaturalDocs 関連の構文解析
*.txsc ファイルを作成する
サンプル
_txsc\(ファイル名.拡張子).txsc の例
<File path="..\Sample.c" type="C_Type">
<TextSection keyword="Function" name="StartA" start_line="100" end_line="129"
next_to_comment_line="110"/>
<TextSection keyword="Function" name="StartB" start_line="130" end_line="159"
next_to_comment_line="140"/>
</File>
BeforeRootFullPath
AfterRootFullPath
セクション化されたテキストのルート・フォルダーのパス
セクション インデックス ファイル(.txsc) のルート・フォルダーのパス
BeforeRootFullPath 引数、AfterRootFullPath 引数に Empty を指定すると、カレント フォルダーを指定した
ときと同じ処理をします。 BeforeRootFullPath 引数、AfterRootFullPath 引数の詳細は、
SectionTypeName
出力ファイルの中の type 属性に入れる文字列
BeforeRootFullPath 引数と AfterRootFullPath 引数に、テキスト ファイルとインデックス ファイルのある場所
の関係を指定します。
参考
→ Natural Docs
TagTypeName = "NaturalDocs" の場合の Sample.c の例
/***********************************************************************
* Function: StartA
************************************************************************/
void StartA()
{
}
/***********************************************************************
* Function: StartB
************************************************************************/
void StartB()
{
}
コールツリー
MakeNaturalComments_C_Language
config->AdditionalKeywords
g_NaturalDocsKeywords
(src)
MakeTextSectionIndexFile
End of File
MakeTextSectionIndexFile
(.vbs)
(.c)
←
▼
▲
Sub ConnectInTextSectionIndexFile( in_IndexFilePath as string,
in_KeywordAndName as array of array of string, in_Empty as Empty )
セクション インデックス ファイルの中の指定したセクションを前のセクションとつなげる。
【引数】
in_IndexFilePath
in_KeywordAndName
セクション インデックス ファイルのパス
前のセクションとつなげるセクションのキーワードと名前の配列
in_Empty
Empty を指定してください
サンプル
_txsc\(ファイル名.拡張子).txsc の例
<File path="..\Sample.c" type="C_Type">
<TextSection keyword="Function" name="StartA" start_line="100" end_line="129"
next_to_comment_line="110"/>
<TextSection keyword="Function" name="StartB" start_line="130" end_line="159"
next_to_comment_line="140"/>
</File>
ConnectInTextSectionIndexFile "Sample.c", Array( Array( "Function", "StartB" ) )
上記 TextSection タグをつなげるスクリプト:
つなげた後の.txsc ファイルの例:
<File path="..\Sample.c" type="C_Type">
<TextSection keyword="Function" name="StartA" start_line="100" end_line="159"
next_to_comment_line="110"/>
</File>
←
▼
▲
Set file = OpenForWriteTextSection( "file.txt", Empty, Empty )
file.Cut "Section1"
file = Empty
Function OpenForWriteTextSection( SourcePath as string, DestinationPath as string,
Option_ as Empty ) as WriteTextSectionClass
セクション化されたテキストの編集を開始します。
【引数】
SourcePath
DestinationPath
編集前のセクション化されたテキスト・ファイルのパス
編集した結果を出力するファイルのパス、または、Empty
Option_
Empty を指定してください
関連
テスト
サンプル
ソース
→ 構造化テキストフォーマット (Module Mixer)
→ ToolsLib.vbs
→ T_TextSection.vbs
返り値
返り値のオブジェクトの参照カウンターが 0 になったら、ファイルに出力されます。
セクション化されたテキスト
セクションを削除します。
file.txt ファイルの中の、"Section1" を含むセクションを削除します。
→ UsesSection (Mxp_Symbol)
残すセクションを選択します。
←
▼
▲
Sub WriteTextSectionClass::Cut( Key as string )
セクションを削除します。
【引数】
Key
セクションの中に含まれる文字列
ソース
→ ToolsLib.vbs
←
▼
▲
Sub WriteTextSectionClass::PickUp( Key as string )
残すセクションを選択します。
【引数】
Key
セクションの中に含まれる文字列
ソース
→ ToolsLib.vbs
本関数を1度でも呼び出すと、WriteTextSectionClass のオブジェクトの参照カウンターが 0
になったとき、選択されなかったセクションはすべて削除されます。
本関数を1度も呼び出さなかったときは、すべてのセクションが残ります。
←
▼
▲
関連
[SectionX]
SettingA = abc
SettingB = 12
; comment
[SectionY]
SettingA = BC
下記の形式のテキストファイルで記述された設定値を扱います。
行末までのコメント記号は、行頭のみ対応
空行も可能
セクション名は省略可能
←
▼
▲
Function ParseIniFileLine( Line as string ) as ParsedIniFileLineClass
.ini ファイルに書かれた行を解析します。
【引数】
Line
.ini ファイルの中の1行
解析結果
返り値
Set line = ParseIniFileLine( "[Section1]" )
'// line.Section = "Section1"
'// line.Name = Empty
'// line.Value = Empty
Set line = ParseIniFileLine( "Name = Value" )
'// line.Section = Empty
'// line.Name = "Name"
'// line.Value = "Value"
Set line = ParseIniFileLine( "Name =" )
'// line.Section = Empty
'// line.Name = "Name"
'// line.Value = ""
Set line = ParseIniFileLine( "comment" )
'// line.Section = Empty
'// line.Name = Empty
'// line.Value = Empty
サンプル
[ ] で囲まれた行は、セクション名として解析します。
= がない行は、コメント行として解析します。
ParsedIniFileLineClass
.Section
.Name
.Value
セクション名
左辺
右辺
テスト
ソース
→ vbslib.vbs
→ T_IniFile.vbs
T_GetIniFileTextValue
←
▼
▲
Function GetIniFileTextValue( IniText as string, SectionName as string,
VariableName as string, Option_ as Empty ) as string
.ini ファイルに書かれた設定値を参照します。
【引数】
IniText
SectionName
.ini ファイルの内容
セクション名、セクションがないファイルでは=Empty
VariableName
変数名
関連
テスト
ソース
変数の設定値
返り値
Empty を指定してください
Option_
→ vbslib.vbs
→ T_IniFile.vbs
T_GetIniFileTextValue
Assert GetIniFileTextValue( text, Empty, "NameA", Empty ) = "Value"
サンプル
該当する変数が存在しないときは、Empty が返ります。
Assert GetIniFileTextValue( text, "SectionB", "NameA", Empty ) = "Value"
←
▼
▲
Function GetIniFileTextValues( IniText as string, SectionName as string,
VariableName as string, Option_ as Empty ) as array of string
.ini ファイルに書かれた設定値を複数参照します。
【引数】
IniText
SectionName
.ini ファイルの内容
セクション名、セクションがないファイルでは=Empty
VariableName
変数名
変数の設定値の配列
返り値
Empty を指定してください
Option_
該当する変数が存在しないときは、空の配列が返ります。
サンプル
Assert IsSameArray( GetIniFileTextValues( text, "Section", "NameA", Empty ), _
Array( "Value1", "Value2" )
テスト
ソース
→ T_IniFile.vbs
T_GetIniFileTextValue
→ vbslib.vbs
←
▼
▲
after_text = SetIniFileTextValue( before_text, Empty, "NameA", "Value", Empty )
Function SetIniFileTextValue( IniText as string, SectionName as string,
VariableName as string, Value as Variant, Option_ as Empty ) as string
.ini ファイルに書かれた設定値を変更します。
【引数】
IniText
SectionName
変更前の .ini ファイルの内容
セクション名、セクションがないファイルでは=Empty
VariableName
変数名
サンプル
変更後の .ini ファイルの内容
返り値
Empty を指定してください
変更後の変数の設定値
Option_
Value
関連
テスト
ソース
→ vbslib.vbs
→ T_IniFile.vbs
T_SetIniFileTextValue
該当する変数が存在しないときは、エラーになります。
←
▼
▲
Sub RenumberIniFileData( ReadStream as TextStream, WriteStream as TextStream,
StartNumber as integer, IsPlusSpaceLineOnly as boolean )
.ini ファイルの内容のうち、= より左にある ( ) の中の番号を振り直します。
【引数】
ReadStream
入力ストリーム
WriteStream
出力ストリーム
開始番号
StartNumber
空行があるときだけ番号を+1するかどうか
IsPlusSpaceLineOnly
サンプル・データ
Data(2) = ABC
Data(5) = DEF
Data(6) = DEF
Data(1) = ABC
Data(2) = DEF
Data(3) = DEF
入力
出力
関連
ソース
→ vbslib.vbs
←
▼
▲
Function ParseJSON( JSON_String as string ) as JS_Object
JSON をパース(構文解析)します。
【引数】
JSON_String
返り値
JSON 形式の文字列データ
JSON のデータにアクセスできるオブジェクト
Set json = ParseJSON( "{'attribute_1':'One', 'attr2':'Two'}" )
echo json.attribute_1 '// "One"
サンプル
→ JSON (JavaScript Object Notation)
参考
(src)
省略された属性に対して、返り値から参照しようとすると、エラー 438 になります。
←
▼
▲
関連
←
▼
▲
CutSharpIf "sample.c", Empty, "SAMPLE", True
Sub CutSharpIf( InputPath as string, OutputPath as string, Symbol as string, IsCutTrue as boolean )
#ifdef 〜 #endif をカットします。
【引数】
InputPath
OutputPath
入力ファイルやフォルダーのパス
出力ファイルやフォルダーのパス
Symbol
#define シンボル、または、#if の条件文
関連
テスト
サンプル
ソース
T_CutSharpIf
IsCutTrue
#if が真の部分をカットする(True)か、偽の部分をカットする(False)か
→ T_CutSharpIf.vbs
→ ToolsLib.vbs
CutSharpIf "FolderA", "FolderB", "SAMPLE_A || SAMPLE_B", False
→ ParsedRanges_getCut_by_PP_Directive
→ vbslib_helper.c
←
▼
▲
Sub CutCommentC( in_Path as string, in_Empty as Empty )
C/C++言語のソース ファイルからコメントを削除します。
【引数】
in_Path
コメントを削除するソース ファイルのパス
in_Empty
Empty を指定してください(予約)
→ clib - CutCommentC_1
コメントを削除する前の内容は上書きされて無くなるので、バックアップを取ってから実行して
ください。
テスト
→ T_CutCommentC.vbs
ソース
→ ToolsLib.vbs
→ vbslib_helper.c
Set w_=AppKey.NewWritable( "Folder" ).Enable()
CutCommentC "Folder\Source.c", Empty
"Folder\Source.c"
参考
T_CutCommentC
in_Path 引数には、
の引数のように ワイルドカードなどを指定できます。
←
▼
▲
テスト
→ T_NaturalDocs.vbs
→ ToolsLib.vbs
ソース
MakeDocumentByNaturalDocs "src", "HTML", Empty
Sub MakeDocumentByNaturalDocs( SourceRootPath as string, DocumentRootPath as string,
Options as Empty )
Natural Docs を実行して、ソースファイルからHTML形式のドキュメントを生成します。
【引数】
SourceRootPath
DocumentRootPath
ソースファイルがあるフォルダーのパス
HTML形式のドキュメントを生成するフォルダーのパス
Options
Empty を指定してください
サンプル
Natural Docs や ActivePerl がインストールされていないと、インストールを即す警告が表示
されます。
参考
DocumentRootPath に指定したパスにフォルダーを消すと、Natural Docs のプロジェクト
フォルダー(キャッシュ)を作り直します。 プロジェクトフォルダーは、
の中に作られ、日付が変わると作り直します。
補足
→ Natural Docs
参考
を設定すると、Natural Docs に入力する拡張子を
変更できます。
ソースファイルは、現在のコードページ(日本なら Shift-JIS)、または Unicode(UTF-16) に
してください。
関連
←
▼
▲
MakeDocumentBy_doxygen "src", "HTML", Empty
Sub MakeDocumentBy_doxygen( SourceRootPath as string, DocumentRootPath as string,
Options as Empty )
doxygen を実行して、ソースファイルからHTML形式のドキュメントを生成します。
【引数】
SourceRootPath
DocumentRootPath
ソースファイルがあるフォルダーのパス
HTML形式のドキュメントを生成するフォルダーのパス
Options
Empty を指定してください
サンプル
参考
ソースファイルは、現在のコードページ(日本なら Shift-JIS)、または Unicode(UTF-16) に
してください。
→ doxygen
関連
テスト
→ T_doxygen.vbs
→ ToolsLib.vbs
ソース
doxygen がインストールされていないと、インストールを即す警告が表示されます。
参考
DocumentRootPath に指定したパスにフォルダーを消すと、Natural Docs のプロジェクト
フォルダー(キャッシュ)を作り直します。 プロジェクトフォルダーは、
の中に作られ、日付が変わると作り直します。
補足
を設定すると、Natural Docs に入力する拡張子を
変更できます。
←
▼
▲
Sub ConvertDocumetCommentFormat( InputPath as string, OutputPath as string,
InputFormat as string, OutputFormatFilePath as string )
プログラムのソースファイルの中にある、ドキュメントに変換できるコメントの形式を変換します。
【引数】
InputPath
OutputPath
InputFormat
現在、"NaturalDocs" のみ指定できます
→ ToolsLib.vbs
テスト
ソース
→ T_TextSection.vbs
T_ConvertDCF
出力するコメントのテンプレートが書かれたファイルのパス
OutputFormatFilePath
入力ファイルやフォルダーのパス
出力ファイルやフォルダーのパス
→ T_ConvertDCF フォルダー
サンプル
コールツリー
ConvertDCF_Class_convert
NaturalCommentClass_printXML
NaturalDocsHeaderClass
(src)
ConvertDCF_onXML_Element
if ( _tcsicmp( in_Status->TagName, _T("Text") ) == 0 ) {
ConvertDCF_Class::Comments.ID
(src)
(src)
NaturalCommentClass
(src)
ConvertDCF_CommentClass_getReplaced
(src)
/* Set "descriptions" : Replaced from "${Descriptions}" */
(src)
ConvertDocumentCommentFormat
ConvertDocumetCommentFormat
1つのコメントを置き換える
MakeNaturalComments_C_Language
NaturalDocs 形式コメントをパースする
現在、C言語の NaturalDocs 形式コメントから、doygen (Javadoc)形式コメントへの変換の
一部のみ可能です。
関連
(src)